{extend name="public/base" /}

{block name="top_info"}
<ul class="top-links">
    <li class="emall">
        <a href="mailto:{$info.mailbox}" target="_blank">
            <i class="icon"></i>
            <span>领导邮箱 </span>
        </a>
    </li>
    <li class="home">
        <a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('{$info.web_url}');"
           href="JavaScript:;">
            <i class="icon"></i>
            <span onclick="SetHome(this, 'http://nmgcqjy.e-jy.com.cn');">设为首页 </span>
        </a>
    </li>
    <li class="follow">
        <a href="javascript:void(0);" onClick="window.external.AddFavorite(document.location.href,document.title)">
            <i class="icon"></i>
            <span>加入收藏 </span>
        </a>
    </li>
    <li class="contact last">
        <a href="{$info.collaborative}" target="_blank">
            <i class="icon"></i>
            <span>协同办公</span>
        </a>
    </li>
</ul>
{/block}

{block name="phone"}
<li>客服 {$info.customer} &nbsp;&nbsp;|&nbsp;&nbsp;纪检监督 {$info.supervise}&nbsp;&nbsp;|&nbsp;&nbsp;清欠投诉
    {$info.complaints}
</li>
{/block}

{block name="search"}
<li class="search-wrapper">
    <div id="divselect" class="base-select  search-select"><cite id="index_search_type">全部信息<i
            class="ico"></i></cite>
        <ul id="index_search_fix">
            <li><a href="javascript:;" selectid="1">全部信息</a></li>
            {volist name="category" id="vo"}
            <li><a href="javascript:;" selectid="{$vo.category_id}">{$vo.category_name}</a></li>
            {/volist}
        </ul>
    </div>
    <input id="searchKid" type="text" placeholder="请输入关键词">
    <input type="hidden" id="SearchKidHidH" value=""/>
    <a href="javascript:void(0)" onclick="allSearch()" class="glass" id="search"></a>
</li>
<script>
    let data = {
        'category_id': 0,
        'category_name': '',
        'keyword': ''
    };
    let searchUrl = '/index/list'
    jQuery.divselect = function (divselectid, inputselectid) {
        var inputselect = $(inputselectid);
        $(divselectid + " cite").click(function (event) {
            var ul = $(divselectid + " ul");
            if (ul.css("display") == "none") {
                ul.slideDown("fast");
            } else {
                ul.slideUp("fast");
            }
            event.stopPropagation();
        });
        $(document).click(function () {
            var ul = $(divselectid + " ul");
            if (ul.css("display") != "none") {
                ul.slideUp("fast");
            }
        });
        $(divselectid + " ul li a").click(function () {
            var txt = $(this).text();
            $(divselectid + " cite").html(txt + '<i class="ico"></i>');
            var value = $(this).attr("selectid");
            inputselect.val(value);
            $(divselectid + " ul").hide();
            data.category_id = value;
            data.category_name = txt;
        });
    };
    $.divselect("#divselect", "#inputselect");

    function allSearch() {
        data.keyword = $('#searchKid').val();
        if (data.keyword.length === 0) {
            return
        }
        searchUrl = `${searchUrl}/${data.category_id}/${data.category_name.length === 0 ? '全部信息' : data.category_name}/${data.keyword}`
        window.location = searchUrl
    }
</script>
{/block}

{block name="bar"}
<div class="header-nav">
    <ul class="container">
        <li class="{$category_name!='首页'??'active'}"><a href="/">首页</a></li>
        {volist name="bar" id="vo"}
        <li class="{$category_name!=$vo.title??'active'}"><a
                href="/index/list/{$vo.id}/{$vo.title}">{$vo.title}</a></li>
        {/volist}
    </ul>
</div>
{/block}
{block name="banner"}
<ul class="slides">
    <div id="banner_tabs" class="flexslider">
        <ul class="slides">
            {volist name="banner" id="vo"}
            <li>
                {if $vo.is_jump==1&&!empty($vo.hyperlink)}
                <a href="{$vo.hyperlink}" target="_blank">
                    <img width="1920" height="350" src="{$vo.image_url}">
                </a>
                {else /}
                <a href="/index/detail/{$vo.id}" target="_blank">
                    <img width="1920" height="350" src="{$vo.image_url}">
                </a>
                {/if}
            </li>
            {/volist}
        </ul>
        <ul class="flex-direction-nav">
            <li><a class="flex-prev" href="javascript:;">Previous</a></li>
            <li><a class="flex-next" href="javascript:;">Next</a></li>
        </ul>
        <ol id="bannerCtrl" class="flex-control-nav flex-control-paging">
            {volist name="banner" id="vo"}
            <li><a>1</a></li>
            {/volist}

        </ol>
    </div>

</ul>
{/block}

{block name="content"}
{__CONTENT__}
{/block}

{block name="partners"}
<ul class="partners">
    <li>
        <dl class="links">
            <dt>
                <span>相关单位</span>
                <i class="dull-down icon"></i>
            </dt>
            <dd>
        		{notempty name="info.units.xgdw"}
                {volist name="info.units.xgdw" id="vo"}
                <a href="{$vo.url}" target="_blank">{$vo.web_name}</a>
                {/volist}
                {/notempty}
            </dd>
        </dl>
    </li>
    <li>
        <dl class="links">
            <dt>
                <span>合作单位</span>
                <i class="dull-down icon"></i>
            </dt>
            <dd>
            	{notempty name="info.units.hzdw"}
                {volist name="info.units.hzdw" id="vo"}
                <a href="{$vo.url}" target="_blank">{$vo.web_name}</a>
                {/volist}
                {/notempty}
               
            </dd>
        </dl>
    </li>
    <li class="last">
        <dl class="links">
            <dt>
                <span>交易机构</span>
                <i class="dull-down icon"></i>
            </dt>
            <dd>
            	{notempty name="info.units.jyjg"}
                {volist name="info.units.jyjg" id="vo"}
                <a href="{$vo.url}" target="_blank">{$vo.web_name}</a>
                {/volist}
                {/notempty}
            </dd>
        </dl>
    </li>
</ul>
{/block}

{block name="footer"}
<div class="footer container">
    <ul class="info">
        <li>地址：{$info.address}</li>
        <li>备案号：{$info.icpn}</li>
        <li>&#169; {$info.c} &nbsp;&nbsp;&nbsp;技术支持：{$info.technical_support}</li>
        <li>联系方式：{$info.contact_details}&nbsp;&nbsp;&nbsp;</li>
        <li>邮箱：{$info.mailbox}</li>
    </ul>
    <ul class="follow">

        <li><img src="{$info.weichat_img}" class="qr"/> <br/>
            <span>微信公众号</span></li>
        <li class="last"><img src="_INDEX_/images/phone.png"/></li>
    </ul>
</div>
{/block}

{block name="js"}
<script type="text/javascript">
    $(function () {
        var bannerSlider = new Slider($('#banner_tabs'), {
            time: 4000,
            delay: 400,
            event: 'hover',
            auto: true,
            mode: 'fade',
            controller: $('#bannerCtrl'),
            activeControllerCls: 'active'
        });
        $('#banner_tabs .flex-prev').click(function () {
            bannerSlider.prev()
        });
        $('#banner_tabs .flex-next').click(function () {
            bannerSlider.next()
        });

        $('[js-tab=2]').tab({
            mouse: 'over',   //切换方式：over，click
            autoPlay: true,  //播放方式：false，true
            curDisplay: 1,     //当前第一个打开
            changeMethod: 'horizontal'  //切换选项：默认default，horizontal，vertical，opacity这4种方式
        });

        $('[js-tab=3]').tab({
            curDisplay: 1,
            changeMethod: 'default'
        });

        $(".links").each(function () {
            var s = $(this);
            var dt = $(this).children("dt");
            var dd = $(this).children("dd");
            var _show = function () {
                dd.slideDown(200);
            }; //展开效果
            var _hide = function () {
                dd.slideUp(200);
            }; //关闭效果
            dt.click(function () {
                dd.is(":hidden") ? _show() : _hide();
                dt.toggleClass("cur");
            });
            dd.find("a").click(function () {
                dt.toggleClass("cur");
                _hide();
            });
            $("body").click(function (i) {
                !$(i.target).parents(".links").first().is(s) ? _hide() : "";
            });
        })

    });
</script>
{/block}